<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    Hello
  </div>
  <script>
    const data = {
      msg: 'Hello',
      number: 1
    }
    const vm = {}
    Object.keys(data).forEach(key => {
      Object.defineProperty(vm, key, {
        get() {
          console.log('get:', data[key]);
          return data[key]
        },
        set(newValue) {
          console.log('set:', newValue);
          data[key] = newValue
        }
      })
    })
    console.log(vm.msg);
    console.log(vm.number);
  </script>
</body>

</html>